package org.example.demo.service.impl;

import org.example.demo.domain.Message;
import org.example.demo.service.IConsumerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class ConsumerServiceImpl implements IConsumerService {
    private static final Logger LOGGER = LoggerFactory.getLogger(ConsumerServiceImpl.class);

    @Override
    public void consume(Message message) {
        LOGGER.info("consuming exchange: {}, routing-key: {}, messageId: {}, extra-id: {}", message.getExchange(), message.getRoutingKey(), message.getMessageId(), message.getAttributes().get("demoId"));
    }
}
